<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>homework</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script type="text/javascript" src="<%=path%>/js/teacher/teaHomework.js"></script>
	<style>
		.datalist{border:1px solid #0058a3;	/* 表格边框 */
							font-family:Arial;
							border-collapse:collapse;	/* 边框重叠 */
							background-color:#eaf5ff;	/* 表格背景色 */
							font-size:18px; }
							
		.datalist caption{padding-bottom:5px;
							font:bold 1.4em;  /*字体大小*/ 51页
							text-align:left; }
							
		.datalist th{  border:1px solid #0058a3;	/* 行名称边框 */
							background-color:#4bacff;	/* 行名称背景色 */
							color:#FFFFFF;		/* 行名称颜色 */
							font-weight:bold;
							padding-top:4px; padding-bottom:4px;
							padding-left:12px; padding-right:12px;
							text-align:center; }
		
		.datalist td{ border:1px solid #0058a3;	/* 单元格边框 */
							text-align:left;
							padding-top:4px; padding-bottom:4px;
							padding-left:10px; padding-right:10px; }

		.datalist tr.altrow{ background-color:#c7e5ff; }


		
		</style>
  </head>
  
  <body style="text-aglin:center">
	  	<center>
	  	<a href="javascript:void(0)" id="addHomework" style="font-size:20px;">添加作业</a><br>
	   		<table id="addTable">
	   			<tr>
	   				<td><s:textfield label="作业名称" name="homeworkName" id="textfield"></s:textfield></td>
	   			</tr>
	   			<tr>
	   				<td><s:select label="课程"  id="select" list="courseList" headerKey="0" headerValue="选择课程" listKey="courseName" listValue="courseName"></s:select></td>
	   			</tr>
	   			<tr>
	   				<td><s:textarea label="作业内容" name="homeworkContent" id="textarea"></s:textarea></td>
	   			</tr>
	   			<tr>
	   				<td><input type="submit" value="提交"/ id="tijiaoHomework"></td>
	   			</tr>
	   		</table>
	   		<s:if test="homeworkList!=null||homeworkList!=''">
	   		<table class="datalist">
		   		<tr>
		   			<th>
		   				作业名称
		   			</th>
		   			<th>
		   				内容
		   			</th>
		   			<th>
		   				课程
		   			</th>
		   			<th>
		   				操作
		   			</th>
		   			
		   		</tr>
		   		
		   		<s:iterator value="homeworkList" status="index">
	   					
		   				
		   				<s:if test="belongTea==#session.tea.teaUserID">
	   					<tr>
	   						<td><s:property value="homeworkName"/></td>
	   						<td><s:property value="homeworkContent"/></td>
	   						<td><s:property value="courseName"/></td>
	   						<td><a href="javascript:void(0)" name="<s:property value="homePath"/>"  class="download">下载</a></td>
	   						
	   					</tr>
	   					</s:if>
	   				</s:iterator>
		   	</table>
	   		</s:if>
	   		
	  </center>
  </body>
</html>
